
#include <stdint.h>

#define RCC_AHB1ENR  (*(volatile uint32_t *)0x40023830)

#define GPIOB_MODER  (*(volatile uint32_t *)0x40020400)
#define GPIOB_ODR    (*(volatile uint32_t *)0x40020414)

int main(void)
{
    // Enable GPIOB clock
    RCC_AHB1ENR |= (1U << 1);

    // Configure PB0, PB7 and PB14 as outputs
    GPIOB_MODER &= ~((3U << 0) | (3U << 14) | (3U << 28));
    GPIOB_MODER |=  ((1U << 0) | (1U << 14) | (1U << 28));

    while (1)
    {
        // Toggle all three LEDs
        GPIOB_ODR ^= (1U << 0) | (1U << 7) | (1U << 14);

        // Delay
        for (volatile uint32_t i = 0; i < 1000000; i++)
        {
        }
    }
}
